home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Environments / Oberon⁄F™ 1.2 / Preinstalled version / Obx / Docu / Open0 (.txt) < prev    next >
Encoding:
Oberon Document  |  1996-07-08  |  3.7 KB  |  65 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Helvetica
  16. Helvetica
  17. Helvetica
  18. Helvetica
  19. TextRulers.StdRulerDesc
  20. TextRulers.RulerDesc
  21. TextRulers.StdStyleDesc
  22. TextRulers.StyleDesc
  23. TextRulers.AttributesDesc
  24. Helvetica
  25. MODULE ObxOpen0;
  26.     IMPORT Files, Converters, Views, Dialog, TextModels, TextMappers, TextViews;
  27.     PROCEDURE Do*;
  28.         VAR loc: Files.Locator; name: Files.Name; conv: Converters.Converter;
  29.             v: Views.View; t: TextModels.Model; f: TextMappers.Formatter;
  30.     BEGIN
  31.         loc := NIL; name := ""; conv := NIL;
  32.         v := Views.Old(Views.ask, loc, name, conv);
  33.         IF (v # NIL) & (v IS TextViews.View) THEN
  34.             t := v(TextViews.View).ThisModel();
  35.             f.ConnectTo(t);
  36.             f.SetPos(t.Length());
  37.             f.WriteString("appendix");
  38.             Views.OpenView(v)
  39.         END
  40.     END Do;
  41. END ObxOpen0.
  42. TextControllers.StdCtrlDesc
  43. TextControllers.ControllerDesc
  44. Containers.ControllerDesc
  45. Controllers.ControllerDesc
  46. Helvetica
  47. DevCommanders.StdViewDesc
  48. DevCommanders.ViewDesc
  49. Helvetica
  50. Oberon by Example: ObxOpen0
  51. This example asks the user for a file, opens the document contained in the file, and appends a string to the text contained in the document. Finally, the text (in its text view) is opened in a window.
  52. After compilation, you can try out the above example:
  53.  ObxOpen0.Do
  54. With this example, we have seen how the contents of an Oberon/F document's root view can be accessed, and how this view can be opened in a window after its contents have been modified. In contrast to ObxHello1, an existing text has been modified; by first setting the formatter to its end, and then appending new text.
  55. Note that similar to the previous examples, views play a central role.
  56. In contrast to traditional development systems and frameworks, files, windows, and applications play only a minor role in Oberon/F, or have completely disappeared as abstractions of their own. The view on the other hand has become a pivotal abstraction. It is an essential property of views that they can be nested, to form hierarchical documents.
  57. These aspects of Oberon/F constitute a fundamental paradigm shift
  58. from monolithic applications to software components
  59. from interoperable programs to integrated components
  60. from closed programs to open environments
  61. from fully specified requirements to extensible interfaces
  62. from application-centered thinking to document-centered thinking
  63. Helvetica
  64. Documents.ControllerDesc
  65.